Content Packs and Modifications

Overview

This document will discuss how to create and distribute content packs, such as map packs, and modifications (mods) for TRON 2.0.  It will detail the directory structure of the game, how to gain access to the content shipped with the game, the directory structure of the Custom directory in the root folder of the game, and other important aspects of mod creation and distribution.

Game Directory Structure

When setting up your content packs and mods it is important to use an exact replica of the directory structure used in TRON 2.0.á If your files are in different directories the game will not be able to find them and no one will be able to play your maps.á To view the correct directory structure of the game you should extract all the files from the Game.rez, Game2.rez, Gamedll.rez and Sound.rez located in the root of your installed TRON 2.0 directory.á Extract each .rez file to the exact same folder (e.g. ôgameö) as described in the overview section of the documentation. Take some time to familiarize yourself with the directory structure so that you can mirror it perfectly when you go to create your own .rez files to distribute your content.á

 

As a simple example, letÆs say you are going to create a new Disc Arena map named TRONOLITH that consists of one new texture, a bunch of existing TRON 2.0 assets (i.e. textures, sounds, etc.) and your new map file.á While working on the map, it would be save the new assets into your existing TRON 2.0 directory structure and name them in such a way that they can easily be pulled out for distribution.á The new textures could be stored in TRON 2.0\Game\Textures\TRONOLITH and similarly, any new assets could be saved using a format of TRONOLITH_assetname so that a wildcard (*.*) search could easily isolate them.á Again, the important thing is that the directory structure is preserved.á Once the map is finished, you would place any new assets that you created into a directory structure of the following form:

 

TRONOLITH\Tex\TRONOLITH\texture.dtx TRONOLITH\Worlds\RetailMultiPlayer\DiscArena\TRONOLITH.dat

 

You would then just need to create a .rez file from the TRONOLITH directory. (See below on how to create .rez files.)

Custom Directory Structure

People wishing to use new content will need to create a Custom directory within their TRON 2.0 folder.á This directory must contain two folders û Mods and Resources. áIn order for other people to properly play your new maps or mods they will need to be placed in these folders.á The Resources folder is where all of the new content-only .rez files, such as maps, should go.á Any .rez file found in this folder will be automatically visible to the game.á Any .rez files containing attribute file changes, changes to existing files, or changes to any of the retail maps within the Resources directory will be ignored by the game.á The Resources folder is a place to put new content that isnÆt necessary tied to a specific mod.á New maps for Disc Arena are a good example.á If you wish to make any code or attribute file modifications you will need to place those .rez files within a separate folder inside the Mods folder.á These files are only visible when the user selects your specific Mod to play when launching the game.á The Resources folder is always available regardless of the Mod selected.á Each mod needs to be in its own folder within the Mods directory and the name of the folder needs to be the name of the mod.á So when adding a new mod, your .rez file(s) need to be in a directory that looks like this:

 

ááááááááááááááááááááááááááááááááááááááááááááááá Custom\Mods\MyCoolMod

 

When zipping your files for download it would be wise to include a brief readme that instructs users on where to place the downloaded files.á Creating a zip file or installer that automatically extracts the files to the proper folders would be ideal.á Please note that the functionality to load Mods and Resources is introduced in the 1.3 Update.á Players will need to have this Update installed to load the new content.

LithRez and Rez files

LithRez.exe, located in the Tools directory, is used to pack and unpack all content into .rez files.  Rez files contain all of the content, maps, models and textures, for the game.á In order to distribute your content packs and mods you will need to pack your resources into a .rez file.á You can create a .rez file by using LithRez through the command prompt.á Change your directory to the tools directory where LithRez.exe is located and type ôlithrezö and hit enter to view how to use the commands.á As an example, if you want to rez your maps you would type the following at the command line:

 

lithrez c MyMaps.rez C:\Program Files\Buena Vista Interactive\TRON 2.0\MyMaps

 

This will create the MyMaps.rez file from the MyMaps directory in your TRON 2.0 directory.

If you want to take a look at the files from the retail version of TRON 2.0 or from other peopleÆs content packs or mods you will need to extract the .rez files into a directory.á HereÆs an example on how to extract the .rez file you just created above:

 

lithrez x MyMaps.rez MyMapsExtracted

 

This will extract all the directories and files from MyMaps.rez to the Directory MyMapsExtracted.

 

When packing your files it is important to remember to have the files set up in a directory structure that is a replica of the original TRON 2.0 directory structure.á You should also make sure that ONLY the files you are creating or modifying belong in the directory structure you are going to pack into a .rez file.á DO NOT include all of the unchanged files from the original game.á That is unnecessary, will take a long time to rez, and will make your .rez file much larger than it needs to be for quick downloads.

 

Creating Asset Lists

 

Asset lists contain the filenames of resources that are used by a level and itÆs components during a game, but are not automatically loaded at the start of the level.á When precaching is turned on in the options menu, TRON 2.0 will look for an assetlist for the level after it is loaded, and then precache all of the resources in the list.á This greatly reduces hitching in the level.á

 

Before you can create asset lists, you will need to install the Perl programming language.á You can download and install ActivePerl free of charge at http:\\www.activestate.com\Products\ActivePerl.á Once this is installed, you can create asset lists like this:

 

1)       In the Advanced Options menu in TRON 2.0 launcher, type in the following on the command line:

 

+errorlog 1 +alwaysflushlog 1 +showfileaccess 1

 

1)       Run the level you wish to build an asset list for.á Make sure you do not use cheats and that you use everything available in the level (i.e., you listen to all conversations, activate every secret, use all available weapons\ammo types, set off any explosions, generate all debris available in the level, scroll through all HUD options, etc.)

 

2)       When you feel confident that you have done everything possible within the level that would require an asset of some sort to be loaded dynamically, quit the game without loading any additional levels.

 

3)       Rename the error.log file to the exact name of the level with a .log file extension (i.e. mylevel.log).

 

4)       You will now need to manually edit the log file so that it only contains resources loaded after the level was completely loaded.á Open the log file with a text editor and delete the following:

 

         All text prior to the line that reads something like: ôLoaded world: Worlds\RetailSinglePlayer\mylevel in 3.87 secondsö

         Everything after the line that reads ôWorld Endedö.

 

5)       Save your changes and exit the text editor.

 

6)       If for any reason you need to play through a level multiple times to ensure that all resources have been recorded, follow steps 1-6 again, making sure to rename each new log file appropriately. When done, youÆll need to create a single log file that combines the contents of all of the smaller files, and rename this to ômylevel.logö.á You do not need to rearrange the contents of your log files in any particular manner, as all the matters is that the complete list of resources is contained in the file that you copy over in the next step.

 

7)       Copy the edited log file to the Tools\AssetLists\logs\new folder.

 

8)       Double click the TRON 2.0\Development\Tools\AssetLists\BuildAssetLists.pl script. When you run this script, the log file in the AssetLists\logs\new directory will be moved to the AssetLists\logs\processed directory and renamed based on the time\date.á The log will then be processed and an intermediate file will be copied to AssetLists\processing.á The final .txt version of the log fill will be copied to AssetLists\final.

 

9)       Copy the AssetLists\Final\levelname.txt file into the Game\Worlds\ directory associated with the level that was logged.á For example, if the level was Game\Worlds\RetailMultiPlayer\dm_mylevel.dat, you would copy the AssetLists\Final\dm_mylevel.txt file to the Game\Worlds\RetailMultiPlayer folder.

 

10)   Your asset list is now complete. The next time you run this level, all of the resources contained in the list will be precached before the level begins.